package com.check.ui;
/**
 * @description:
 * @Author: zyt
 */

import com.check.bean.UiList;
import com.check.utils.ListUtils;
import com.check.utils.LoadFxmlUtils;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;

public class Check {

    private Stage stage;
    public UiList uiList = UiList.getUIList();

    public Check(){
        if(uiList.getCheck()==null){
            uiList.setCheck(this);
        }
    }

    public void start(Stage primaryStage){
        this.setStage(primaryStage);
        String path = "/fxml/check.fxml";
        Parent root;
        try {
            root = LoadFxmlUtils.getParent(path);
        } catch (IOException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        // 设置窗口标题
        primaryStage.setTitle("设置检查项");
        Scene scene = new Scene(root,522,465);
        // 禁止更改大小,默认true可以更改
        primaryStage.setResizable(false);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public Stage getStage() {
        return stage;
    }

    public void setStage(Stage stage) {
        this.stage = stage;
    }
}
